package com.sskj.jingbi.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.jingbi.http.HttpConfig;
import com.sskj.jingbi.ui.activity.MainActivity;
import com.sskj.lib.bean.AppVersionBean;
import com.sskj.lib.http.JsonCallBack;


public class MainActivityPresenter extends BasePresenter<MainActivity> {
    public void getNewVersion() {
        httpService.getVersion()
                .execute(new JsonCallBack<HttpData<AppVersionBean>>(false) {
                    @Override
                    public void onSuccess(Response<HttpData<AppVersionBean>> response) {
                        HttpData<AppVersionBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.onVersionDataSuccess(httpData.getData());
                        }
                    }

                });
    }
}
